-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
manager: use portable epoch time computation #1900
Conversation
Summary: Fixes #1895 by replacing the (apparently unportable) `%s` format specifier with an explicit subtraction from epoch. Test Plan: I don’t have easy access to a Windows machine with a Bazel/TensorBoard setup, but I verified that this expression can be evaluated by itself: ``` Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> import datetime >>> dt = datetime.datetime.now() >>> dt.strftime("%s") Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> dt.strftime("%s") ValueError: Invalid format string >>> int((dt - datetime.datetime.fromtimestamp(0)).total_seconds()) 1551203889 ``` Running `git grep strftime.*%s` returns no matches as of this commit. wchargin-branch: windows-strftime
LGTM, bonus points for good use of labels. |
Summary: Fixes tensorflow#1895 by replacing the (apparently unportable) `%s` format specifier with an explicit subtraction from epoch. Test Plan: I don’t have easy access to a Windows machine with a Bazel/TensorBoard setup, but I verified that this expression can be evaluated by itself: ``` Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> import datetime >>> dt = datetime.datetime.now() >>> dt.strftime("%s") Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> dt.strftime("%s") ValueError: Invalid format string >>> int((dt - datetime.datetime.fromtimestamp(0)).total_seconds()) 1551203889 ``` Running `git grep strftime.*%s` returns no matches as of this commit. wchargin-branch: windows-strftime
Summary: Fixes #1895 by replacing the (apparently unportable) `%s` format specifier with an explicit subtraction from epoch. Test Plan: I don’t have easy access to a Windows machine with a Bazel/TensorBoard setup, but I verified that this expression can be evaluated by itself: ``` Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> import datetime >>> dt = datetime.datetime.now() >>> dt.strftime("%s") Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> dt.strftime("%s") ValueError: Invalid format string >>> int((dt - datetime.datetime.fromtimestamp(0)).total_seconds()) 1551203889 ``` Running `git grep strftime.*%s` returns no matches as of this commit. wchargin-branch: windows-strftime
Sadly:
My server is set to UTC, so This works, but is gross:
|
Got it! I did go as far as checking the release notes this PR was cherry picked into... but I didn't go to check the next one. Thanks! |
Sure thing, and thank you for reporting it! |
Summary:
Fixes #1895 by replacing the (apparently unportable)
%s
formatspecifier with an explicit subtraction from epoch.
Test Plan:
I don’t have easy access to a Windows machine with a Bazel/TensorBoard
setup, but I verified that this expression can be evaluated by itself:
Running
git grep strftime.*%s
returns no matches as of this commit.wchargin-branch: windows-strftime